home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er 1989 February
/
64er_Magazin_89-02_1989_Markt__Technik_de_Disk_2_of_2_Side_A.d64
/
easy triangles
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
4KB
|
119 lines
100 rem *******************************
110 rem * easy triangles v1.0 *
120 rem *-----------------------------*
130 rem * (w) by f. schneider in 1988 *
140 rem * (c) 64'er (markt & technik) *
150 rem *******************************
160 :
170 s0$=" =":s1$=" "+s0$:s2$="[146][211]eite ":s3$="[146][215]inkel "
180 s4$="[211]eitenhalbierende ":s5$="[215]inkelhalbier. ":s6$="alpha":s7$="beta "
190 s8$="gamma":s9$="[200]oehe auf "+s2$:goto520
200 rem --- rechenunterroutinen
210 n=a:p=x
220 m=n*sin((NULL)*o/f)/sin((NULL)*p/f):return
230 m=(n^2+o^2-p^2)/(2*n*o):ifm>=1orm<=-1goto700
240 m=(-atn(m/sqr(1-m^2))+(NULL)/2)*f/(NULL):return
250 m=sqr(n^2+o^2-2*n*o*cos((NULL)*p/f)):return
260 ifn<othenpoke2,2
270 m=o*sin((NULL)*p/f)/n:m=m+1:m=m-1:ifm=1thenm=90:return
280 ifm>1goto700
290 m=atn(m/sqr(1-m^2))*f/(NULL):return
300 m=n*sin((NULL)*o/f)/(sin((NULL)*(f-p/2-o)/f)):return
310 rem --- verzoegerung / tastatur
320 fori=0to1500:next:goto520
330 poke198,0
340 geta$:ifa$=""goto340
350 return
360 rem --- systemroutinen
370 d=d-1:ifpeek(e-d)=1thenprint"";
380 return
390 ifa<>0theno=a:gosub260:x=m:goto910
400 return
410 ifm<0thengoto670
420 e=e+1:ifm<>0thenpokee,1:d=d+1:ife>=2027thend=d+3
430 return
440 print"[146] --------------------------------------":return
450 print" "s2$"a"s1$;:return
460 print" [159]"s2$"b"s1$;:return
470 print" [153]"s2$"c"s1$;:return
480 print" [153]"s3$s6$s0$;:return
490 print" [159]"s3$s7$s0$;:return
500 print" "s3$s8$s0$;:return
510 rem --- hauptprogramm
520 poke53280,0:poke53281,0:poke53272,23:poke657,128:poke198,0:poke2,1
530 fori=2024to2029:pokei,0:next:a=0:b=0:c=0:d=0:e=2023:f=180:x=0:y=0:z=0
540 print"[147]"tab(10)"[197]asy [212]riangles v1.0"
550 printtab(6)"(w) by [198]. [211]chneider in 1988":gosub450
560 inputa:m=a:print:gosub410:gosub460:inputb:m=b:print:gosub410:gosub470:inputc:m=c
570 print"":gosub410:gosub480:inputx:m=x:print:gosub410:gosub490:inputy:m=y:print
580 gosub410:gosub500:inputz:m=z:print:gosub410
590 rem --- eingabe pruefen
600 ifx>=180ory>=180orz>=180orx+y>=180ory+z>=180orx+z>=180goto670
610 ifd=9goto910
620 ifd=6goto780
630 ifd=3goto730
640 ifd<3ord=4ord=5ord=8goto680
650 ifd=7ord=10ord=11ord>12goto690
660 rem --- systemmeldungen
670 print""tab(10)"unzulaessige [215]erte !":goto320
680 print""tab(10)"zu wenig [208]arameter !":goto320
690 print""tab(9)"nur 3 [215]erte eingeben !":goto320
700 print"[147]"tab(12)"keine [204]oesung !":gosub330:goto520
710 rem --- rechenroutinen
720 rem --- 3 seiten
730 ifx=0thenn=b:o=c:p=a:gosub230:x=m
740 ify=0thenn=a:o=c:p=b:gosub230:y=m
750 ifz=0thenn=a:o=b:p=c:gosub230:z=m
760 goto1010
770 rem --- 2 seiten + eing. winkel
780 ifa<>0andb<>0andz<>0thenn=a:o=b:p=z:gosub250:c=m:goto730
790 ifb<>0andc<>0andx<>0thenn=b:o=c:p=x:gosub250:a=m:goto730
800 ifa<>0andc<>0andy<>0thenn=a:o=c:p=y:gosub250:b=m:goto730
810 rem --- 2 seiten + 1 winkel
820 ifx<>0thenn=a:p=x:goto840
830 goto860
840 ifb<>0theno=b:gosub260:y=m:goto910
850 o=c:gosub260:z=m:goto910
860 ify<>0thenn=b:p=y:gosub390:goto880
870 goto890
880 o=c:gosub260:z=m:goto910
890 n=c:p=z:gosub390:o=b:gosub260:y=m
900 rem --- 1 seite + 2 winkel
910 w=f-x-y-z
920 ifx=0thenx=w
930 ify=0theny=w
940 ifz=0thenz=w
950 ifc<>0thenn=c:p=z:goto980
960 ifb<>0thenn=b:p=y:goto980
970 ifa<>0theno=y:gosub210:b=m:goto990
980 o=x:gosub220:a=m:ifb=0theno=y:gosub210:b=m:goto1010
990 o=z:gosub210:c=m
1000 rem --- hoehen/s.-halb./w.-halb.
1010 ha=b*sin((NULL)*z/f):hb=c*sin((NULL)*x/f):hc=a*sin((NULL)*y/f):n=a/2:o=c:p=y:gosub250:sa=m
1020 n=b/2:o=a:p=z:gosub250:sb=m:n=c/2:o=b:p=x:gosub250:sc=m:n=c:o=y:p=x:gosub300
1030 wal=m:n=a:o=z:p=y:gosub300:wbe=m:n=b:o=x:p=z:gosub300:wga=m:um=a+b+c
1040 fl=.5*a*b*sin((NULL)*z/f)
1050 rem --- loesungen ausgeben
1060 d=6:g=65:ifpeek(2)=3theng=66
1070 print"[147]"tab(9)"[204]oesungen "chr$(g)":":gosub450:gosub370:printa:gosub460
1080 gosub370:printb:gosub470:gosub370:printc:gosub440:gosub480:gosub370:printx
1090 gosub490:gosub370:printy:gosub500:gosub370:printz:gosub440
1100 print" "s9$"a ="ha:print" [159]"s9$"b ="hb:print" [153]"s9$"c ="hc:gosub440
1110 print" [153]"s4$"a ="sa:print" [159]"s4$"b ="sb:print" "s4$"c ="sc:gosub440
1120 print" "s5$s6$" ="wal:print" [159]"s5$s7$" ="wbe:print" [153]"s5$s8$" ="wga:gosub440
1130 print" [153][198]laecheninhalt ="fl:print" [159][213]mfang "s1$um:gosub330:close1
1140 ifa$="[136]"thenopen1,4,0:cmd1:goto1060
1150 ifpeek(2)<>2goto520
1160 rem --- 2. loesung bei ssw(k)
1170 poke2,3:ifpeek(e-2)=1goto1210
1180 ifpeek(e-1)=1goto1230
1190 ifpeek(e-5)=1thenb=0:y=0:goto1270
1200 a=0:x=0:goto1260
1210 ifpeek(e-4)=1thenc=0:z=0:goto1260
1220 b=0:y=0:goto1250
1230 ifpeek(e-5)=1thenc=0:z=0:goto1270
1240 a=0:x=0
1250 z=f-z:goto910
1260 y=f-y:goto910
1270 x=f-x:goto910